home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / rpg / crossfir.92 / crossfir / crossfire-0.92.5 / doc / spoiler / Imakefile < prev    next >
Makefile  |  1996-07-24  |  5KB  |  156 lines

  1. /*   CrossFire, A Multiplayer game for X-windows
  2.  *
  3.  *   $Id: Imakefile,v 1.3 1993/12/18 03:18:53 kjetilho Exp $
  4.  *
  5.  *   Copyright (C) 1992 Frank Tore Johansen
  6.  *
  7.  *   This program is free software; you can redistribute it and/or modify
  8.  *   it under the terms of the GNU General Public License as published by
  9.  *   the Free Software Foundation; either version 2 of the License, or
  10.  *   (at your option) any later version.
  11.  *
  12.  *   This program is distributed in the hope that it will be useful,
  13.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *   GNU General Public License for more details.
  16.  *
  17.  *   You should have received a copy of the GNU General Public License
  18.  *   along with this program; if not, write to the Free Software
  19.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *   The author can be reached via e-mail to frankj@ifi.uio.no.
  22.  */
  23.  
  24. #include "../../config/crossfire.tmpl"
  25.  
  26. FILES = Imakefile README monster-extract spells-extract stats-extract \
  27.     arm-extract \
  28.     helm-extract mag-extract shield-extract items-extract spoiler.tex \
  29.     sorter makeps \
  30.     empty.pbm bow-extract arche-extract weap-extract
  31.  
  32. TEX =    monput.tex spells.tex stats.tex weap.tex shield.tex helmet.tex \
  33.     mag.tex arm.tex arche.tex bow.tex version.tex weapmag.tex
  34.  
  35.  CROSSRC = ../..
  36.   INCDIR = $(CROSSRC)/include
  37.   IMGDIR = $(CROSSRC)/doc/spoiler
  38. CROSSBIN = $(C_BINDIR)/crossfire
  39.  
  40. #define MAKEPS(in,out) $(AWK) -v libdir=$(CROSSRC)/lib \
  41.     -v archdir=$(CROSSRC)/lib/ -v size=0.4 -v input=in \
  42.     -f makeps $(C_LIBDIR)/archetypes > out
  43.  
  44. /*
  45. CROSSBIN= $(C_BINDIR)/$(HOSTTYPE)/crossfire.`cat $(C_BINDIR)/$(HOSTTYPE)/last`
  46. */
  47.  
  48. spoiler:: ../spoiler.ps
  49.  
  50. ../spoiler.ps: spoiler.dvi
  51.     dvips -o ../spoiler.ps spoiler.dvi
  52.  
  53. all::
  54.  
  55. spoiler.dvi: spoiler.aux
  56.     latex spoiler.tex
  57.  
  58. /* longtables requires one extra run to save alignment in spoiler.aux.
  59.  */
  60. spoiler.aux: spoiler.tex $(TEX)
  61.     $(RM) spoiler.aux
  62.     latex spoiler.tex
  63.  
  64. $(CROSSBIN):
  65.     @$(RM) dump_switches
  66.     @$(CROSSBIN) -m >/dev/null 2>&1 && touch dump_switches ||\
  67.     (echo "You need to define DUMP_SWITCHES in include/config.h and";\
  68.     echo "recompile before you can create the spoilers.")
  69.     @$(MAKE) $(MFLAGS) check_ok
  70.  
  71. check_ok: dump_switches
  72.     @$(RM) dump_switches
  73.  
  74. .bmaps: $(C_LIBDIR)/archetypes
  75.     $(RM) *.ps
  76.     touch .bmaps
  77.  
  78. items: .bmaps in_items makeps items.ps
  79.     MAKEPS(in_items,items)
  80.  
  81. in_items: items-extract $(C_LIBDIR)/archetypes $(CROSSRC)/common/living.c
  82.     $(AWK) -v living_c=$(CROSSRC)/common/living.c \
  83.         -f items-extract $(C_LIBDIR)/archetypes > in_items
  84.  
  85. stats.tex: .bmaps in_stats makeps characters.ps
  86.     MAKEPS(in_stats,stats.tex)
  87.  
  88. in_stats: stats-extract $(C_LIBDIR)/archetypes $(CROSSRC)/common/living.c
  89.     $(AWK) -v living_c=$(CROSSRC)/common/living.c \
  90.         -f stats-extract $(C_LIBDIR)/archetypes > in_stats
  91.  
  92. monput.tex: .bmaps in_monput makeps monsters.ps
  93.     MAKEPS(in_monput,monput.tex)
  94.  
  95. in_monput: monster-extract $(CROSSBIN) $(C_LIBDIR)/treasures $(C_LIBDIR)/archetypes
  96.     $(CROSSBIN) -m2 | tr A-Z a-z | sort | \
  97.         $(AWK) -F'|' -f monster-extract > in_monput
  98.  
  99. spells.tex: .bmaps in_spells makeps spells.ps
  100.     MAKEPS(in_spells,spells.tex)
  101.  
  102. in_spells: spells-extract sorter $(INCDIR)/spellist.h $(CROSSBIN) $(C_LIBDIR)/archetypes
  103.     tr -d \" < $(INCDIR)/spellist.h | \
  104.         $(AWK) -F, -v crosscmd="$(CROSSBIN) -m4" \
  105.             -f spells-extract | sort > in_spells
  106.  
  107. version.tex: $(CROSSBIN)
  108.     $(CROSSBIN) -v 2>&1 | grep "^This is" | \
  109.         cut -d" " -f3- > version.tex
  110.  
  111. /* These dummy files are used to detect 'rm *.ps'
  112.  */
  113. characters.ps items.ps monsters.ps spells.ps:
  114.     touch $@
  115.  
  116. weap.tex: items sorter
  117.     egrep -e "^15 " items | $(AWK) -F'&' '{printf("%s &%s &%s &%.2f &%s\n",$$3,$$10,$$5,$$11,$$6)}' |\
  118.     sort | $(AWK) -F'&' -f sorter -v lengde=`egrep -e "^15" items | \
  119.     wc -l | tr -d ' ' ` | sort | cut -d'&' -f 2- > weap.tex
  120.  
  121. shield.tex: items shield-extract
  122.     egrep -e "^33 " items | $(AWK) -F'&' -f shield-extract | sort > shield.tex
  123.  
  124. arm.tex: items arm-extract
  125.     egrep -e "^16 " items | $(AWK) -F'&' -f arm-extract | sort -t'&' -n +4 -5 > arm.tex
  126.  
  127. helmet.tex: items helm-extract
  128.     egrep -e "^34 " items | $(AWK) -F'&' -f helm-extract | \
  129.         sort -t'&' -n +3 -4 | sed -e s/_/' '/g > helmet.tex
  130.  
  131. bow.tex: items bow-extract
  132.     egrep -e "^14 " items | $(AWK) -F'&' -f bow-extract | sort > bow.tex
  133.  
  134. arche.tex: items arche-extract
  135.     egrep -e "^915 " items | $(AWK) -F'&' -f arche-extract | sort > arche.tex
  136.  
  137. weapmag.tex: items weap-extract
  138.     egrep -e "^15 " items | $(AWK) -F'&' -f weap-extract | sort > weapmag.tex
  139.  
  140. mag.tex: items mag-extract
  141.     $(AWK) -F'&' -f mag-extract items | sort +0.9 -0.10 > mag.tex
  142.  
  143. install::
  144.  
  145. depend::
  146.  
  147. clean::
  148.     $(RM) $(TEX)
  149.     $(RM) items .bmaps in_monput in_items in_spells
  150.     $(RM) *.ps *x*.ppm tmp.ppm work.ppm
  151.     $(RM) spoiler.dvi spoiler.log spoiler.aux
  152.  
  153. InsertArchive($(FILES),doc/spoiler)
  154.  
  155. # Depends:
  156.